﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

namespace WebSite.General
{
    public partial class VerVacante : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //string s = this.Request.QueryString["VacID"].ToString();
        }

        protected object EvaluateIfPuestoEqualsNull()
        {
            return (Eval("Puesto") == null) ? "<span class=\"LetraRoja\">No Especificado</span>" : Eval("Puesto");
        }

        protected void GridView_DatosVacante_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                string str = ((string)DataBinder.Eval(e.Row.DataItem, "Empresa.Foto"));
                // Retrieve the GridView control in the second column.
                if (((string)DataBinder.Eval(e.Row.DataItem, "Empresa.Foto")) != null)
                {
                    ((Image)e.Row.FindControl("Image_Logo")).ImageUrl = ((string)DataBinder.Eval(e.Row.DataItem, "Empresa.Foto"));
                }
                else
                {
                    ((Image)e.Row.FindControl("Image_Logo")).ImageUrl = "~\\Pictures\\CompanyPictures\\DefaultCompanyPic.png";
                }

                if (((ListBox)e.Row.FindControl("ListBox_DatosVacanteHabilidades")).Items.Count == 0)
                {
                    ((ListBox)e.Row.FindControl("ListBox_DatosVacanteHabilidades")).Visible = false;
                    ((Label)e.Row.FindControl("Label_DatosVacanteNoHabilidades")).Visible = true;
                }
                if (((ListBox)e.Row.FindControl("ListBox_DatosVacanteEspecialidades")).Items.Count == 0)
                {
                    ((ListBox)e.Row.FindControl("ListBox_DatosVacanteEspecialidades")).Visible = false;
                    ((Label)e.Row.FindControl("Label_DatosVacanteNoPostgrados")).Visible = true;
                }

            }
        }
    }
}
